<template>
  <div id="setting">
    <div class="header" style="">
      <van-image class="avatar" :src="userinfo['avatar'] ? uploadBaseUrl + userinfo['avatar'] : ''"
                 width="80" height="80" fit="cover"/>
      <div style="height: 80px;float: left;margin-left: 20px;">
        <div style="margin-top: 10px;">
          <span style="font-weight: bold;font-size: 20px;">
            {{ userinfo['name'] || '' }}
          </span>
          <div style="clear: both" />
        </div>
        <div style="font-size: 16px;margin-top: 10px;">
          <div style="float: left">
<!--            留白-->
<!--            烟台山别墅店-->
          </div>
        </div>
      </div>
      <div style="float: right;font-size: 14px;margin-top: 13px;margin-right: 28px;">
        <div>
          {{  userinfo['date'] || '' }}
        </div>
        <div style="margin-top: 14px;">
<!--          签到时间: 13:00-->
        </div>
      </div>
      <div style="clear: both" />
    </div>


<!--    <van-cell title="打卡" is-link to="/setting/clock_in" />-->
<!--    <van-cell title="员工手册" is-link to="/setting/clock_in" />-->
<!--    <van-cell title="指标/奖励" is-link to="/setting/comment_reward" />-->
<!--    <van-cell title="创建账号" is-link to="/setting/register" v-if="!['employee'].includes($store.state.userinfo.right)"/>-->
    <van-cell title="员工账号管理" is-link to="/setting/user-manage" v-if="hasRight(['master', 'boss', 'manager'])"/>
    <van-cell title="修改密码" is-link to="/setting/change-password" />
    <van-cell title="登出" is-link to="/login" />
    <div style="height: 10px;" />
<!--    <van-cell title="员工考勤统计" is-link to="/setting/cal_employee" />-->
：
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {

    }
  },
  mounted() {

  },
  computed: {
    userinfo() {
      return this.$store.state.user.userinfo;
    },
    uploadBaseUrl() {
      return this.$store.state.publicConfig.uploadBaseUrl;
    },
    hasRight() {
      return (rightList) => {
        return this.$store.dispatch('hasRight', rightList);
      }
    }
  }
}
</script>

<style lang="scss">

#setting {
  .header {
     background: #fff;height: 90px;
     padding: 15px 20px 15px 20px;
    .avatar {
      float: left;
      img {
        border-radius: 5px;
      }
    }

  }



}


</style>
